package com.func.types.event;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 * BaseEvent
 * </p>
 *
 * @author Simon
 * @version 2025.03.13.1.0.0
 * @description
 * @since 2025-03-13
 */

@Data
public abstract class BaseEvent<T> {
    public abstract EventMessage<T> buildEventMessage(T data);
    public abstract String topic();

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class EventMessage<T> {
        private String id;
        private Date timeStamp;
        private T data;
    }
}
